home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 882 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.2 KB  |  33 lines

  1. Path: lasernet.com!jonathan_wooldridge
  2. Newsgroups: comp.lang.c++
  3. Message-ID: <60107174040$71C7@lasernet.com>
  4. X-Gateway: Act-Up 4.6  07 Jan 96 17:40:40  LaserNet, Serving Fido style systems
  5. Date: Sun, 7 Jan 96 13:25:45 LOC
  6. Organization: 1BBS ■ Imperial Beach CA ■ 619∙429∙6521/6123 ■ (52:1000/153)
  7. From: Jonathan Wooldridge <jonathan_wooldridge@lasernet.com>
  8. Subject: Spherical Distribution
  9.  
  10. Let's skip the deg/radians/rads stuff and just say that the measure
  11.     of a circle is 1, half a circle is 1/2, and a typical slice of
  12.     pizza is 1/6 (or 1/8 depending on size preference), ok?
  13.  
  14. Distributing x number of points about the circumference is easy;
  15.     each point is 1/x-th of the way around the circle. i.e.:
  16.  
  17.     // Assume an array of structures that contain an angle element
  18.  
  19.     for (int thisPoint = 0; thisPoint < NumPoints; thisPoint++)
  20.         point[thisPoint].angle = 1/thisPoint;   // angle as a fraction
  21.  
  22.  
  23. So much for 2D flatworld. Now, my question is this:
  24.     Is there a way to distribute x number of points evenly across
  25.     the surface of a sphere?
  26.  
  27.              -=| SpyroGyra |=-
  28. ... "Life is tough.  It's tougher when you're stupid." - John Wayne
  29. -!-
  30.  * TLX v4.00 *
  31.  
  32. ---
  33.